package com.qf.kady.ssm.pojo;

import com.alibaba.druid.sql.visitor.functions.Char;
import com.qf.kady.ssm.utils.DateUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * \* Created with IntelliJ IDEA.
 * \* User: kady
 * \* Date: 2021/4/21
 * \* Time: 11:50
 * \* 千峰JAVA2101班
 * \* Description: 读者实体
 * \
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Reader {
    private Long readerId;
    private String readerName;
    private String sex;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birth;
    private String birthStr;
    private String address;
    private String phone;
    private String password;

    public String getBirthStr() {
        return birth!=null?DateUtil.dateToStr(birth,"yyyy-MM-dd"):"";
    }
}
